from django.db import models
from django.contrib.auth.models import AbstractUser, User


class User(AbstractUser):
    STATE = (
        (1, "正常"),
        (2, "下线"),
    )
    email = models.CharField(max_length=50, verbose_name='邮箱')
    mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号')

    class Meta:
        permissions = (
            ('add_user_per', '添加用户权限'),
            ('del_user_per', '删除用户权限'),
            ('change_user_per', '修改用户权限'),
            ('sel_user_per', '查询用户权限'),
        )
        db_table = 'User'
        verbose_name = '用户'
        verbose_name_plural = verbose_name
